<?php
/* @var $this MonitorController */
/* @var $model Monitor */

$this->breadcrumbs=array(
	'Manage',
);

?>

<script type="text/javascript">
	function initialize() {
	  var mp = new BMap.Map('baiduMap');
	  mp.centerAndZoom(new BMap.Point(121.491, 31.233), 11);
	}
	 
	function loadScript() {
	  var script = document.createElement("script");
	  script.src = "http://api.map.baidu.com/api?v=1.5&ak=5a90faa9eadcf6b86a4165ea8f218b47&callback=initialize";//此为v1.5版本的引用方式
	  // http://api.map.baidu.com/api?v=1.5&ak=您的密钥&callback=initialize"; //此为v1.4版本及以前版本的引用方式
	  document.body.appendChild(script);
	}
	 
	window.onload = loadScript;
</script>
<div class="row-fluid">
	<div class="span12">
		<div class="alert alert-info">
			<h1 class="text-center"> <?php echo Yii::t('monitor','The construction site scene'); ?> </h1>
		</div>
	</div>
</div>
<div class="row-fluid">
	<div class="span4">
	</div>
	<div class="span8">	
		<div id="baiduMap" style="min-width:500px;min-height:320px"></div>
	</div>
</div>



<?php $this->widget('bootstrap.widgets.TbButton', array(
    'label'=>'点击查看帮助说明',
    'type'=>'danger',
    'htmlOptions'=>array('data-title'=>'Title', 'data-content'=>'请依次选择县城、项目和网络摄像机以查看监控视频或图像', 'rel'=>'popover'),
)); ?>

<div id="quote-of-the-day">
    <?php $this->renderPartial('_quote', array(
        'quote' => $quote,
    ))?> 
</div>


<div id="county-group" class="btn-group">
	<button id="county-btn" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
		选择县城 <span class="caret"></span>
	</button>
	<ul class="dropdown-menu">
		<li><?php echo CHtml::ajaxLink('甘孜县', array('getQuote'),
        	array(	'update' => '#quote-of-the-day', 'success' => 'js:function(html){jQuery("#quote-of-the-day").html(html); jQuery("#county-group").attr("class","btn-group"); jQuery("#county-btn").html("甘孜县 <span class=\"caret\"></span>")}'))?></li>
		<li><?php echo CHtml::ajaxLink('康定县', array('getQuote'),
        	array(	'update' => '#quote-of-the-day', 'success' => 'js:function(html){jQuery("#quote-of-the-day").html(html); jQuery("#county-group").attr("class","btn-group"); jQuery("#county-btn").html("康定县 <span class=\"caret\"></span>")}'))?></li>
		<li><a href="#">泸定县</a></li>
	</ul>
</div>

<div id="project-group" class="btn-group">
	<button class="btn btn-info dropdown-toggle" data-toggle="dropdown">
		选择项目 <span class="caret"></span>
	</button>
	<ul class="dropdown-menu">
		<li><a href="#">项目1</a></li>
		<li><a href="#">项目2</a></li>
	</ul>
</div>

<div id="camera-group" class="btn-group">
	<button class="btn btn-success dropdown-toggle" data-toggle="dropdown">
		选择项目 <span class="caret"></span>
	</button>
	<ul class="dropdown-menu">
		<li><a href="#">摄像机1</a></li>
		<li><a href="#">摄像机2</a></li>
	</ul>
</div>


<?php $this->widget('bootstrap.widgets.TbGridView', array(
//	'id'=>'project-grid',
	'type'=>'striped bordered condensed',
	'template'=>"{items}",
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'county_id',
		'name',
		'description',
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'htmlOptions'=>array('style'=>'width: 50px'),
		),
	),
)); ?>
